/*
 * AbstractCollection.h
 *
 *  Created on: 2012-5-17
 *      Author: esf
 */

#ifndef ABSTRACTCOLLECTION_H_
#define ABSTRACTCOLLECTION_H_

#include "Collection.h"

namespace collection {
template <class E>
class AbstractCollection:virtual public collection::Collection<E>,virtual public Object{
public:
	AbstractCollection(){}
	virtual ~AbstractCollection(){}
	virtual int size()=0;
	virtual bool isEmpty();
	virtual bool contains(Object &o);
	virtual Iterator<E> iterator()=0;
	virtual Object* toArray();
	virtual bool add(E&e);
	virtual bool remove(E&e)=0;
	virtual bool containsAll(Collection<E>&c)=0;
	/**
	 * 仅保留Collection中的元素，其余去除
	 */
	virtual bool retainAll(Collection<E>&c)=0;
	virtual std::string toString();




};

} /* namespace collection */
#endif /* ABSTRACTCOLLECTION_H_ */
